$('.handle').on('click',function(){
	var id = $(this).data('id');
	$('.modall-back[data-id="'+id+'"]').show();
});

$('.modal-close').on('click',function(){
	$('.modall-back').hide();
});
  $(" .checkbox ").click(function(){

        //console.log( $(this).parent().parent("tr").index())//?????????index
//    ???
        var url=$(this).attr("src");
        //console.log(url);
        if(url=="../../themes/v1.0/images/green_yes1.png"){
            $(this).attr("src","../../themes/v1.0/images/green_yes.png");
        }else{
            $(this).attr("src","../../themes/v1.0/images/green_yes1.png");
        }
    if($(this).attr('data-type') == 1)
    {
        $(this).attr('data-type',0);
    }else
    {
        $(this).attr('data-type',1);
    }

    });

$('.sure').on('click',function(){
	var id = $(this).data('id');
	var tongzhi = $('.tongzhi[data-id="'+id+'"]').attr('data-type');
	var collec = $('.collec[data-id="'+id+'"]').attr('data-type');
	var score = $('input[data-id="'+id+'"]:checked').attr('data-score');
	var reason = $('.reason[data-id="'+id+'"]').val();

	$.post(
		'cancel.html',
		{'id':id,'tongzhi':tongzhi,'reason':reason,'collec':collec,'score':score,'_csrf':$('.request-csrf').val()},
		function(res){
			res = eval('('+res+')');
			if(res.code==400)
			{
				alert(res.msg)
			}else{
				location.reload();
			}
		});
});


  $('.btn-new').on('click',function(event){
             var id = $(this).parent().data('id');
            window.location.href="detail.html?id="+id;
});